import _ from 'lodash'

export function debounce(fn,replay){
    let timer = null
    return function(...args){
        if(timer){
            clearInterval(timer)
        }
        timer = setTimeout(()=>{
            fn.apply(this.args)
        },replay)
    }
}